#pragma once
#include "CXcpObjectBase.h"
#include "IPALAbortableOperation.h"
#include "CXcpObjectThreadSafeAddRefPolicy.h"
#include "PALImageDecodeParams.h"

class ImageDecodeRequest :
	public CXcpObjectBase<IPALAbortableOperation,CXcpObjectThreadSafeAddRefPolicy>
{

public: 
	static HRESULT Create(const struct PALImageDecodeParams & params, struct IImageAvailableCallback * pCallback, ImageDecodeRequest * * ppDecodeRequest);
	const struct PALImageDecodeParams & GetDecodeParams();
	virtual HRESULT Abort();
	HRESULT NotifyDownloadProgress(XFLOAT downloadProgress);
	HRESULT NotifyCallback(struct IImageAvailableResponse * pResponse);

private: 
	ImageDecodeRequest(const struct PALImageDecodeParams & params, struct IImageAvailableCallback * pCallback);
	virtual ~ImageDecodeRequest();
	struct PALImageDecodeParams m_decodeParams;
	struct IImageAvailableCallback * m_pCallback;
};